<template>
    <fs-page class="PageFeatureSearchMulti">
        <fs-crud ref="crudRef" v-bind="crudBinding">
            <template #actionbar-right>
                <importExcel api="api/order/" v-auth="'OrderViewSet:Import'">导入</importExcel>
            </template>
        </fs-crud>
    </fs-page>
</template>

<script lang="ts">
import { onMounted, getCurrentInstance, defineComponent } from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import createCrudOptions from './crud';
import importExcel from '/@/components/importExcel/index.vue'

export default defineComponent({
    name: "Order",
    components: { importExcel },
    setup() {
        const instance = getCurrentInstance();
        const context: any = {
            componentName: instance?.type.name
        };

        const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });

        onMounted(() => {
            crudExpose.doRefresh();
        });

        return {
            crudBinding,
            crudRef,
        };
    }
});
</script> 